#!/usr/bin/env python 
# -*- coding: utf-8 -*-  

import math

class Section:
    def __init__(self, _start_point, _end_point = None):
        self.start_point, self.end_point = _start_point, _end_point
        self.point_array = []
                
    def get_start_point(self):
        return self.start_point
    
    def get_end_point(self):
        return self.end_point
    
    def get_tangent(self):
        deltay = float((self.end_point.get_y() - self.start_point.get_y()))
        deltax = float((self.end_point.get_x() - self.start_point.get_x()))
        if deltax != 0:
            angle = math.atan(deltay/deltax)
        else:
            angle = math.pi*deltay/(2*abs(deltay))
        return abs(angle)
    
    def set_end_point(self, _end_point):
        self.end_point = _end_point
    
    def get_point_array(self):
        return self.point_array
    
    def append_to_point_array(self, _point):
        self.point_array.append(_point)